package com.itshizhan.designpattern.iterator;


public class IteratorApp {
    public static void main(String[] args) {
        BookShelf bookShelf = new BookShelf(4);
        bookShelf.appendBook(new Book("Around the world in 80 days"));
        bookShelf.appendBook(new Book("Bible"));
        bookShelf.appendBook(new Book("Cinderalla"));
        bookShelf.appendBook(new Book("Daddy long eggs"));
        Iterator iterator = bookShelf.iterator();
        while (iterator.hasNext()) {
            Book book = (Book) iterator.next();
            System.out.println("book name  = " + book.getName());
        }

    }
}
